<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%
    String id  = request.getParameter("id");
    if(id==null){
    	id="";
    }
   %>
<script type="text/javascript">
	var matendetailgrid;
	var id = $('#id').val();
	$(function() {
	    alert(id);
		matendetailgrid = $('#matendetailgrid')
				.datagrid(
						{
							//title : '商品列表',
							url : '${ctx}/maintenance/expense/detail/list?id='+id,
							striped : true,
							rownumbers : true,
							pagination : true,
							singleSelect : true,
							idField : 'id',	
							frozenColumns : [ [ {
								width : '120',
								title : '商品名称',
								field : 'productname'
								
							} ] ],
							columns : [ [
									{
										width : '150',
										title : '所属分类',
										field : 'pathname'
									},
									{
										width : '120',
										title : '所配车型',
										field : 'brandname'
									},
									{
										width : '80',
										title : '原价(元)',
										field : 'yprice'
									},
									{
										width : '80',
										title : '现价(元)',
										field : 'xprice'
									},
									{
										width : '120',
										title : '添加时间',
										field : 'createTime'
									},
									{
										width : '80',
										title : '状态',
										field : 'state',
										formatter : function(value, row, index) {
											switch (value) {
											case 0:
												return '未启用';
											case 1:
												return '启用';
											}
										}
									},
									{
										width : '150',
										title : '操作',
										field : 'action',
										formatter : function(value, row) {
											var str = "";
										
											return str;
										}
									} ] ],	
							onBeforeLoad : function(param) {
								parent.$.messager.progress({
									text : '数据加载中....'
								});
							},
							onLoadSuccess : function(data) {
									
								parent.$.messager.progress('close');
							}
							
							
						});
	});

</script>
<!-- 界面布局  -->
<div class="easyui-layout" style="width: 100%; height: 100%;"
	data-options="fit:true,border:false">
       <input type="hidden"  id="id" value="<%=id %>"/>
	
	<div data-options="region:'center',title:'保养产品管理'" style="padding: 2px;">
		<div class="easyui-layout" data-options="fit : true,border : false">
			<div data-options="region:'center',border:false">
				<table id="matendetailgrid" data-options="fit:true,border:false"></table>
			</div>
		</div>
	</div>
	
</div>